/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.timekeeper.store;

import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.N150;
import queenb.web.timekeeper.inteface.N150Inf;

import queenb.web.util.PackageContants;

/**
 *
 * @author Administrator
 */
public class N150Store extends N150 implements N150Inf {

    @Override
    public int updateN150(int pnPN150, int pnFH000, int pnFH200, int pnFC250, String pvNV151, Timestamp pdND152,
            String pvNV116,
            String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.UPDATE_N150, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPN150),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFC250),
                        new Param(OracleTypes.CHAR, pvNV151),
                        new Param(OracleTypes.TIMESTAMP, pdND152),
                        new Param(OracleTypes.CHAR, pvNV116),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, N150.class);
        } catch (SQLException ex) {
            Logger.getLogger(N150Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }

    @Override
    public List<N150> getListCombC250(int pnFH000,
            int pnFH200,
            String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.LIST_COMBC550, OracleTypes.CURSOR, new queenb.net.datacontrol.Param[]{
                        new queenb.net.datacontrol.Param(OracleTypes.INTEGER, pnFH000),
                        new queenb.net.datacontrol.Param(OracleTypes.INTEGER, pnFH200),
                        new queenb.net.datacontrol.Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(dataStatement, N150.class);
        } catch (SQLException ex) {
            java.util.logging.Logger.getLogger(N150Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(N150Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(N150Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<N150> listTabN150(int pnFH000, int pnFH200, int pnFC250, int pnFN100, Date pnND152F, Date pnND152T, String pvLOGIN) {
        try {
            DataStatement data = new DataStatement(PackageContants.LIST_N150, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFC250),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.DATE, pnND152F),
                        new Param(OracleTypes.DATE, pnND152T),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(data, N150.class);
        } catch (SQLException ex) {
            Logger.getLogger(N150Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(N150Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(N150Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public List<N150> listTabN150Late(int pnFH000, int pnFH200, int pnFC250, int pnFN100, Date pnND152F, Date pnND152T, String pvLOGIN) {
        try {
            DataStatement data = new DataStatement(PackageContants.LIST_N150LATE, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFC250),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.DATE, pnND152F),
                        new Param(OracleTypes.DATE, pnND152T),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(data, N150.class);
        } catch (SQLException ex) {
            Logger.getLogger(N150Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(N150Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(N150Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
}
